package net.zwet.clanworks.resthome.responses;

import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: zwet
 * Date: 17-12-13
 * Time: 15:01
 * To change this template use File | Settings | File Templates.
 */
@XmlRootElement
public class NewsResponse {
    private int id;
    private String Title;
    private String Teaser;
    private String Text;
    private String Author;
    private Date CreationDate;
    private Date PublishingDate;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return Title;
    }

    public void setTitle(String title) {
        Title = title;
    }

    public String getTeaser() {
        return Teaser;
    }

    public void setTeaser(String teaser) {
        Teaser = teaser;
    }

    public String getText() {
        return Text;
    }

    public void setText(String text) {
        Text = text;
    }

    public String getAuthor() {
        return Author;
    }

    public void setAuthor(String author) {
        Author = author;
    }

    public Date getCreationDate() {
        return CreationDate;
    }

    public void setCreationDate(Date creationDate) {
        CreationDate = creationDate;
    }

    public Date getPublishingDate() {
        return PublishingDate;
    }

    public void setPublishingDate(Date publishingDate) {
        PublishingDate = publishingDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        NewsResponse news = (NewsResponse) o;

        if (id != news.id) return false;
        if (!Author.equals(news.Author)) return false;
        if (!CreationDate.equals(news.CreationDate)) return false;
        if (!PublishingDate.equals(news.PublishingDate)) return false;
        if (!Teaser.equals(news.Teaser)) return false;
        if (!Text.equals(news.Text)) return false;
        if (!Title.equals(news.Title)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + Title.hashCode();
        result = 31 * result + Teaser.hashCode();
        result = 31 * result + Text.hashCode();
        result = 31 * result + Author.hashCode();
        result = 31 * result + CreationDate.hashCode();
        result = 31 * result + PublishingDate.hashCode();
        return result;
    }
}
